package com.dubbo.consumer.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.dubbo.entity.SysUser;
import com.dubbo.service.HelloService;
import com.dubbo.service.SysUserService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class HelloController {

    @Reference
    private HelloService helloService;
    @Reference
    private SysUserService sysUserService;

    @RequestMapping(value = "/hello")
    public String hello() {
        List<SysUser> user=sysUserService.queryById();
        String hello = helloService.sayHello("world");
        System.out.println(helloService.sayHello("BJQ"));
        return hello+user.toString();
    }

}
